<template>
  <div>
    <nav-bar :title="title" btntitle="添加授权" :isShow="true" @click-right="onClick"></nav-bar>
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad">
      <van-cell v-for="item in list" :key="item.id" is-link :title="item.name" :value="item.telephone" :to="{name:'card_agency_update', params:{user_id:item.id + ''}}" />
    </van-list>
  </div>
</template>

<script>
import NavBar from "@/components/NavBar"
import { card_agency_list } from '@/api/service'

export default {
  name: "CardAgency",
  components: {
    NavBar,
  },

  data() {
    return {
      title: this.$route.meta.title,
      list: [],
      loading: false,
      finished: false,
    };
  },
  computed: {

  },
  methods: {
    onClick() {
      this.$router.push("/card_agency_add");
    },
    onLoad() {
      card_agency_list().then(res=>{
        console.log(res);
        this.list = res.data
        this.loading = false;
        this.finished = true;
      }).catch(error=>{
        console.log(error);
      })
    },
  },

  created() {

  },

}
</script>

<style  scoped>

</style>